import { createRouter, createWebHistory } from 'vue-router'

// 导入组件
const Login = () => import('../views/UserLogin.vue')
const Home = () => import('../views/MainHome.vue')
const Chat = () => import('../views/AIChat.vue')
const ChatHistory = () => import('../views/ChatHistory.vue')
const UserCenter = () => import('../views/UserCenter.vue')

// 定义路由
const routes = [
  { path: '/', redirect: '/login' },
  { path: '/login', name: 'UserLogin', component: Login },
  { path: '/home', name: 'MainHome', component: Home },
  { path: '/chat', name: 'AIChat', component: Chat },
  { path: '/chat-history', name: 'ChatHistory', component: ChatHistory },
  { path: '/user-center', name: 'UserCenter', component: UserCenter }
]

// 创建路由实例
const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router